#include <stdio.h>
#include<stdio.h>
#include<sys/types.h>
#include<sys/stat.h>
#include<unistd.h>
#include <fcntl.h>

int main()
{
   FILE *fp;
   char c;
   int addr;

   fp = fopen("abc.txt", "a+");
   addr = fseek(fp, 1, SEEK_SET);
   printf(" 此时文件位置： %d \n",addr);
   
   c = fgetc(fp);
    printf(" %c \n",c);
    

   if( ferror(fp) )
   {
      printf("1.读取文件：file.txt 时发生错误\n");
   }
   clearerr(fp);
   if( ferror(fp) )
   {
      printf("2.读取文件：file.txt 时发生错误\n");
   }
   fclose(fp);

   return(0);
}